package com.hzdl.car.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzdl.car.bean.CarRentInfo;
import com.hzdl.car.bean.CarReturn;
import com.hzdl.car.mapper.CheckMapper;
import com.hzdl.car.service.CheckService;
import com.hzdl.car.vo.CarReturnVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CheckServiceImpl implements CheckService {

    @Autowired
    private CheckMapper cm;
    @Override
    public PageInfo findByWhere(CarReturnVo carReturnVo) {
        PageHelper.startPage(carReturnVo.getPage(),carReturnVo.getLimit());
        List<CarReturn> crList = cm.findByWhere(carReturnVo);
        PageInfo pageInfo = new PageInfo(crList);
        return pageInfo;
    }

    @Override
    public int updateCheck(CarReturnVo carReturnVo) {
        return cm.updateCheck(carReturnVo);
    }

    @Override
    public int deleteCheck(String checkid) {
        return cm.deleteCheck(checkid);
    }
}
